<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>模板html</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
    <style type="text/css">
        body {
            padding-top: 80px;
            background: rgba(245, 245, 245, 1);
            padding-bottom: 50px;
            padding-top: 80px;
        }

        .m-fixed-top-mod {
            z-index: 999;
            position: fixed;
            top: 0;
            width: 100%;
            height: 80px;
            padding: 0 15px;
            background: rgba(90, 194, 255, 1);
        }

        .c-fixed-state {
            font-size: 18px;
            font-weight: 600;
            color: rgba(255, 255, 255, 1);
        }

        .c-fixed-content {
            font-size: 13px;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            margin-top: 10px;
        }

        .m-fixed-bottom-mod {
            z-index: 999;
            position: fixed;
            left: 0;
            bottom: 0;
            width: calc(100% - 30px);
            height: 50px;
            padding: 0 15px;
            box-sizing: content-box;
            background: rgba(255, 255, 255, 1);
        }

        .m-fixed-bottom-mod::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 1px;
            background: rgba(212, 212, 212, 1);
            transform: translateY(0.5);
        }

        .m-fixed-txt {
            font-size: 12px;
            font-weight: 400;
            color: rgba(25, 25, 25, 1);
        }

        .m-fixed-price {
            font-size: 18px;
            font-weight: 600;
            line-height: 16px;
            color: rgba(255, 101, 24, 1);
        }

        .m-fixed-btn-default {
            padding: 0 15px;
            height: 32px;
            border-radius: 18px;
            border: 1px solid rgba(25, 25, 25, 1);
            margin-left: 10px;
            font-size: 15px;
            font-weight: 400;
            color: rgba(25, 25, 25, 1);
            line-height: 15px;
        }

        .c-order-btn-highlight {
            padding: 0 15px;
            height: 32px;
            background: rgba(253, 155, 67, 1);
            border-radius: 18px;
            margin-left: 10px;
            font-size: 15px;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
            line-height: 15px;
        }

        .m-container-mod {
            margin: 15px;
            padding: 15px;
            background: rgba(255, 255, 255, 1);
            box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.02);
            border-radius: 8px;
        }

        .c-pos-img {
            width: 30px;
            height: 30px;
            min-width: 30px;
            margin-right: 15px;
        }

        .c-arrow-img {
            width: 24px;
            height: 24px;
            min-width: 24px;
            margin-left: 14px;
        }

        .c-user-name {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
        }

        .c-user-phone {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(161, 165, 177, 1);
            line-height: 20px;
            margin-left: 10px;
        }

        .c-user-address {
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
            margin-top: 5px;
        }

        .o-order-goods {
            height: 80px;
            margin-top: 15px;
        }

        .o-order-goods:first-of-type {
            margin-top: 0;
        }

        .c-goods-img {
            width: 60px;
            min-width: 60px;
            height: 80px;
            margin-right: 12px;
        }

        .c-goods-name {
            height: 18px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
            line-height: 18px;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }

        .o-goods-sub {
            margin-top: 10px;
            height: 18px;
        }

        .c-goods-des {
            height: 18px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(191, 191, 191, 1);
            line-height: 18px;
        }

        .c-goods-count {
            height: 18px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(191, 191, 191, 1);
            line-height: 18px;
        }

        .c-goods-price {
            margin-top: 10px;
            height: 20px;
            font-size: 14px;
            font-weight: 600;
            color: rgba(255, 101, 24, 1);
            line-height: 20px;
        }

        .o-row {
            height: 20px;
            margin-top: 15px;
        }

        .o-row:first-child {
            margin-top: 0;
        }

        .c-key {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
            word-wrap: break-word;
        }

        .c-tips {
            height: 18px;
            background: rgba(255, 245, 217, 1);
            border-radius: 4px;
            padding: 0 7px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(231, 109, 0, 1);
            margin-left: 17px;
        }

        .c-price-default {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
        }

        .c-price-lowlight {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(191, 191, 191, 1);
            line-height: 20px;
        }

        .c-price-highlight {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(231, 109, 0, 1);
            line-height: 20px;
        }

        .c-txt-secondary {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(90, 90, 90, 1);
            line-height: 20px;
        }

        .c-transport-title {
            font-size: 15px;
            font-weight: bold;
            color: rgba(63, 64, 70, 1);
            line-height: 21px;
            margin-bottom: 8px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .c-transport-time {
            font-size: 14px;
            font-weight: 400;
            color: rgba(161, 165, 177, 1);
        }

        .title {
            font-size:14px;
            font-weight:400;
            color:rgba(25,25,25,1);
            line-height:20px;
        }

        .msg {
            font-size:14px;
            font-weight:400;
            color:rgba(90,90,90,1);
            line-height:20px;
            margin-top: 10px;
        }
        
        .imgs {
            flex-wrap: wrap;
        }

        .imgs img {
            width: 80px;
            height: 80px;
            margin-top: 10px;
            margin-right: 10px;
        }
    </style>
</head>

<body>
    <div class="vueApp" v-cloak>
        <div class="m-fixed-top-mod" data-flex="cross:center">
            <div>
                <div class="c-fixed-state">{{ statusText }}</div>
                <div class="c-fixed-content" v-html="statusContent"></div>
            </div>
        </div>
        <!-- 收货地址 -->
        <div v-if="omsAddress" class="m-container-mod">
            <div data-flex="cross:center">
                <img class="c-pos-img" src="../../image/ui/address_2.png" alt="">
                <div data-flex-box="1">
                    <div data-flex="cross:center">
                        <div class="c-user-name">{{ omsAddress.name }}</div>
                        <div class="c-user-phone">{{ omsAddress.phone }}</div>
                    </div>
                    <div class="c-user-address">
                        {{ omsAddress.provinceName }} {{ omsAddress.cityName }} {{ omsAddress.regionName }}<br>{{ omsAddress.detailAddress }}
                    </div>
                </div>
            </div>
        </div>
        <div v-else class="m-container-mod">
            <div data-flex="cross:center">
                <img class="c-pos-img" src="../../image/ui/address_2.png" alt="">
                <div data-flex-box="1">
                    <div data-flex="cross:center">
                        <div class="c-user-name">{{ orderInfo.receiverName }}</div>
                        <div class="c-user-phone">{{ orderInfo.receiverPhone }}</div>
                    </div>
                    <div class="c-user-address">
                        {{ orderInfo.receiverProvinceName }} {{ orderInfo.receiverCityName }} {{ orderInfo.receiverRegionName }}<br>{{ orderInfo.receiverDetailAddress }}
                    </div>
                </div>
            </div>
        </div>
        <!-- 最新物流信息 -->
        <div class="m-container-mod" v-if="transportInfo" @click="transportHandle">
            <div data-flex="cross:center">
                <img class="c-pos-img" src="../../image/ui/transport.png" alt="">
                <div data-flex-box="1">
                    <div data-flex="cross:center">
                        <div class="c-transport-title">
                            {{ transportInfo.context }}
                        </div>
                    </div>
                    <div class="c-transport-time">
                        {{ transportInfo.ftime }}
                    </div>
                </div>
                <img class="c-arrow-img" src="../../image/ui/arrow_right.png" alt="">
            </div>
        </div>
        <!-- 购买商品列表 -->
        <div class="m-container-mod">
            <div class="o-order-goods" v-for="item in orderInfo.orderItemList" data-flex>
                <img class="c-goods-img" :src="item.productPic" alt="">
                <div data-flex-box="1">
                    <div class="c-goods-name">{{ item.productName }}</div>
                    <div class="o-goods-sub" data-flex="main:justify">
                        <div class="c-goods-des">{{ item.productAttr }}</div>
                        <div class="c-goods-count">x{{ item.productQuantity }}</div>
                    </div>
                    <div class="c-goods-price">¥{{ item.productPrice }}</div>
                </div>
            </div>
        </div>
        <!-- 订单优惠信息，仅在申请后不显示 -->
        <div class="m-container-mod" v-if="status != 20">
            <div class="o-row" data-flex="main:justify cross:center">
                <div data-flex="cross:center">
                    <div class="c-key">商品合计</div>
                </div>
                <div class="c-price-default">¥{{ orderInfo.totalAmount }}</div>
            </div>
            <div class="o-row" data-flex="main:justify cross:center">
                <div data-flex="cross:center">
                    <div class="c-key">运费</div>
                    <!-- <div class="c-tips" data-flex="main:center cross:center">满199包邮</div> -->
                </div>
                <div class="c-price-lowlight">¥{{ orderInfo.freightAmount }}</div>
            </div>
            <div class="o-row" data-flex="main:justify cross:center">
                <div data-flex="cross:center">
                    <div class="c-key">活动优惠</div>
                    <!-- <div class="c-tips" data-flex="main:center cross:center">3件9.8折</div> -->
                </div>
                <div class="c-price-highlight">¥{{ orderInfo.promotionAmount }}</div>
            </div>
        </div>
        <div v-if="status != 20">
            <div v-for="item in orderFields" class="m-container-mod">
                <div class="o-row" v-for="field in item" data-flex="main:justify cross:center">
                    <div data-flex="cross:center">
                        <div class="c-key">{{fieldsDesc[field]}}</div>
                    </div>
                    <div class="c-price-default">
                        {{orderInfo[field] || ''}}</div>
                </div>
            </div>
            <div class="m-container-mod" v-if="status == '2' && orderInfo.closeExamineReason">
                <div class="o-row">
                    <div class="title">审核失败原因</div>
                </div>
                <div class="msg">{{ orderInfo.closeExamineReason }}</div>
            </div>
        </div>
        <div v-else>
            <div class="m-container-mod" v-if="shType == '_1'">
                <div class="o-row" data-flex="main:justify cross:center">
                    <div class="c-key">退款金额</div>
                    <div class="c-price-lowlight">¥{{ orderInfo.returnAmount }}</div>
                </div>
            </div>
            <div class="m-container-mod">
                <div class="o-row">
                    <div class="title">售后原因</div>
                </div>
                <div class="msg">{{ orderInfo.reason }}</div>
            </div>
            <div class="m-container-mod" v-if="orderInfo.proofPics.length">
                <div class="o-row">
                    <div class="title">图片凭证</div>
                </div>
                <div class="imgs" data-flex="cross:center">
                    <img v-for="item in orderInfo.proofPics" :src="item" alt="">
                </div>
            </div>
            <div class="m-container-mod" v-if="shStatus == '3'">
                <div class="o-row">
                    <div class="title">拒绝原因</div>
                </div>
                <div class="msg">{{ orderInfo.handleNote || '无' }}</div>
            </div>
            <div class="m-container-mod">
                <div class="o-row" data-flex="main:justify cross:center">
                    <div class="c-key">售后单号</div>
                    <div class="c-price-default">{{ orderInfo.orderSn }}</div>
                </div>
                <div class="o-row" data-flex="main:justify cross:center">
                    <div class="c-key">提交时间</div>
                    <div class="c-price-default">{{ orderInfo.createTime }}</div>
                </div>
            </div>
            <div class="m-container-mod" v-if="orderInfo.passingTime">
                <div class="o-row" data-flex="main:justify cross:center">
                    <div class="c-key">售后处理时间</div>
                    <div class="c-price-default">{{ orderInfo.passingTime }}</div>
                </div>
            </div>
            <div class="m-container-mod" v-if="orderInfo.returnMoneyTime || orderInfo.exchangeTime">
                <div class="o-row" data-flex="main:justify cross:center" v-if="orderInfo.returnMoneyTime">
                    <div class="c-key">退款时间</div>
                    <div class="c-price-default">{{ orderInfo.returnMoneyTime }}</div>
                </div>
                <div class="o-row" data-flex="main:justify cross:center" v-if="orderInfo.exchangeTime">
                    <div class="c-key">换货时间</div>
                    <div class="c-price-default">{{ orderInfo.exchangeTime }}</div>
                </div>
            </div>
        </div>
        <footer class="m-fixed-bottom-mod" v-if="statusBtn.length > 0" data-flex="main:justify cross:center">
            <div data-flex="main:left cross:center" v-if="status == 12">
                <div class="m-fixed-txt">应付：</div>
                <div class="m-fixed-price">{{ orderInfo.payCount }}</div>
            </div>
            <div v-else></div>
            <div data-flex="main:right cross:center">
                <div v-for="item in statusBtn" :class="item.className || 'm-fixed-btn-default'"
                    data-flex="main:center cross:center" @click="fnHandleOrderBtn(item, orderInfo)">
                    {{ item.name }}
                </div>
            </div>
        </footer>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/service/service-tool.js"></script>
<script type="text/javascript" src="../../script/service/service-app.js"></script>
<script type="text/javascript" src="../../script/service/service-user.js"></script>
<script type="text/javascript" src="../../script/service/service-logic.js"></script>
<script type="text/javascript" src="../../script/service/service-order.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">
    // html 的引号一律为双引号(""),js 为单引号('')
    var USER, $S, vm, pageParam;
    var orderTime = '';
    var timeOut;
    var orderInfoFields = {
        // 待付款
        '12': [['orderSn', 'createTime']],
        // 待发货
        '2': [['payCount', 'payType'], ['orderSn', 'createTime', 'paymentTime']],
        // 待收货
        '3': [['payCount', 'payType'], ['orderSn', 'createTime', 'paymentTime'], ['deliveryTime']],
        // 已收货
        '4': [['payCount', 'payType'], ['orderSn', 'createTime', 'paymentTime'], ['deliveryTime', 'receiveTime']],
        // 已完成
        '5': [['payCount', 'payType'], ['orderSn', 'createTime', 'paymentTime'], ['deliveryTime', 'receiveTime']], // , ['orderCompletionTime'] 字段缺少
        // 已关闭
        '15': [['orderSn', 'createTime'], ['closeTime']]
    },
    fieldsDesc = {
        'orderSn': '订单编号',
        'createTime': '创建时间',
        'payCount': '支付金额',
        'payType': '支付方式',
        'paymentTime': '支付时间',
        'backReason': '售后原因',
        'backProof': '售后凭证',
        'deliveryTime': '发货时间',
        'receiveTime': '收货时间',
        'orderCompletionTime': '订单完成时间',
        'closeTime': '订单关闭时间'
    };
    apiready = function () {
        $S = SERVICE();
        USER = USER();
        pageParam = api.pageParam;
        pageParam._type = pageParam._type === undefined ? '' : pageParam._type;
        pageParam._status = pageParam._status === undefined ? '' : pageParam._status;
        
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');
        fnInit();
    };
    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                orderInfo: {},
                status: pageParam.status,
                shType: pageParam._type,
                shStatus: pageParam._status,
                orderFields: orderInfoFields[pageParam.status],
                fieldsDesc: fieldsDesc,
                id: pageParam.id,
                transportInfo: '',
                isSellService: false, // 是否允许售后
                omsAddress: null,
                invoiceStatus: ''
            },
            computed: {
                statusText: function () {
                    console.log(this.status + '' + this.shType);
                    return fnOrderStatusText(this.status + '' + this.shType);
                },
                statusContent: function () {
                    if(this.shStatus == '1' && this.shType == '1') {
                        return '退款中...';
                    }
                    if(this.status == '2' && this.orderInfo.closeExamineStatus == '0') {
                        return '取消订单审核中...'
                    }
                    if(this.status == '2' && this.orderInfo.closeExamineStatus == '1') {
                        return '取消订单审核成功'
                    }
                    if(this.status == '2' && this.orderInfo.closeExamineStatus == '2') {
                        return '取消订单审核失败'
                    }
                    return fnOrderStatusDesc(this.status + '' + this.shStatus);
                },
                statusBtn: function() {
                    var status = vm.status + '' + vm.shType + '' + vm.shStatus;
                    return getBottomBtn(status);
                }
            }
        });
        fnGetSellService();
        getTransportInfo();
    }

    // 获取是否允许售后
    function fnGetSellService() {
        if(pageParam.status == 20) {
            var params = {
                id: '1',
                entityName: 'omsOrderSetting'
            };
            var callback = function(data) {
                vm.isSellService = data.serviceStatus == 1;
                getData();
            };
            POST('common/get', params, callback)
        }else {
            getData();
        }
    }

    // 查看物流
    function transportHandle() {
        fnOpenPublicWin('物流详情', 'teacher/transport', {
            orderId: pageParam.id
        });
    }

    function deepCopy(sender) {
        var result;
        if(typeof sender === 'object') {
            result = JSON.parse(JSON.stringify(sender));
        }else if(typeof sender === 'string') {
            result = sender + '';
        }else {
            result = sender;
        }
        return result;
    }
    function cleanEmpty(sender) {
        var temp = deepCopy(sender || []);
        var data = [];
        for(var i = 0; i < temp.length; i ++) {
            var item = temp[i];
            if(item !== null && item !== undefined && item !== '') {
                data.push(item);
            }
        }
        return data;
    }

    // 获取订单详情数据
    function getData() {
        var url = 'single/oms/detail';
        var params = {
            'id': pageParam.id
        };
        if(vm.status == 20) {
            url = 'single/oms/order/aftersalesinfo';
        }
        var callback = function (data) {
            var data2 = {};
            if(vm.status == 20) {
                data2 = data.order;
                data2.receiverName = data.returnName;
                data2.receiverPhone = data.returnPhone;
                data2.shId = data.id;
                data2.reason = data.reason;
                if(String(data.proofPics) != 'null') {
                    data2.proofPics = cleanEmpty(data.proofPics.split(','));
                } else {
                    data2.proofPics = '';
                }
                data2.passingTime = data.handleTime;
                data2.returnMoneyTime = data.receiveTime;
                data2.exchangeTime = data.receiveTime;
                data2.handleNote = data.handleNote;
                data2.returnAmount = data.returnAmount;
                data2.orderItemList = [
                    {
                        productPic: data.productPic,
                        productName: data.productName,
                        productAttr: data.productAttr,
                        productQuantity: data.productCount,
                        productPrice: data.productPrice
                    }
                ];
                vm.omsAddress = data.omsCompanyAddress;
                vm.shStatus = data.status;
                vm.shType = '_'+data.type;
                data = data2;
            } else {
                vm.status = data.status;
            }
            data.payType = getPayType(data.payType);
            data.createTime = formatTime(data.createTime);
            data.paymentTime = formatTime(data.paymentTime);
            data.deliveryTime = formatTime(data.deliveryTime);
            data.closeTime = formatTime(data.closeTime);
            data.receiveTime = formatTime(data.receiveTime);
            data.exchangeTime = formatTime(data.exchangeTime);
            data.returnMoneyTime = formatTime(data.returnMoneyTime);
            data.passingTime = formatTime(data.passingTime);
            vm.orderInfo = data;
            vm.orderFields = orderInfoFields[vm.status];
            vm.invoiceStatus = data.invoiceStatus;
            vm.$nextTick(function() {
                if(vm.status == '12') {
                    orderTime = Number(data.orderOvertimeSetting);
                    getOrderTime();
                };
            });
        };
        MALLGET(url, params, callback);
    }

    // 获取支付方式
    function getPayType(type) {
        var text = '';
        switch(type) {
            case 2:
                text = '支付宝';
                break;
            case 1:
                text = '微信';
                break;
            case 5:
                text = '余额';
                break;
            default:
                console.error(type+'==找不到该支付方式');
                text = '未知';
                break;
        };
        return text;
    }

    // 获取物流信息
    function getTransportInfo() {
        if(vm.status == 3 || vm.status == 4 || vm.status == 5) {
            var url = 'single/oms/logisticbyapi';
            var params = {
                'orderId': pageParam.id
            };
            var callback = function (data) {
                vm.transportInfo = data.data[0];
            };
            MALLPOST(url, params, callback);
        }
    }

    // 获取订单剩余时间
    function getOrderTime() {
        timeOut = setTimeout(function() {
            var text = '';
            orderTime --;
            if(orderTime <= 0 && vm.status == '12') {
                clearTimeout(timeOut);
                vm.status = 15;
                fnCancleOrder(pageParam.id);
                return;
            }
            var hour = parseInt(orderTime / 3600);
            var minute = parseInt(orderTime % 3600 / 60);
            var second = parseInt(orderTime % 3600 % 60);
            if(hour >= 1) {
                text += hour + '小时';
            };
            if(minute >= 1) {
                text += minute + '分';
            };
            if(second >= 1) {
                text += second + '秒';
            };
            document.getElementById('orderLeftTime').innerText = text;
            getOrderTime();
        },1000)
    }

    // 订单事件处理结果回调
    // status: true 成功 false 失败
    // event: 参考service-tools.js 834行
    function orderEventCallback(status, event) {
        console.error('detail==status==='+ status +'===event==='+ event);
        api.execScript({
            name: pageParam.winName,
            frameName: pageParam.frameName,
            script: 'orderEventCallback('+ status +',"'+ event +'",'+ pageParam.orderIndex +');'
        });
        switch(event) {
            case 'cancle':
                // 取消订单
                getData();
                if(vm.status == '2') {
                    fnToast('取消订单审核中');
                }
                break;
            case 'recieveGoods':
                // 确认收货
                getData();
                break;
            case 'deteleOrder':
                // 删除订单
                api.closeWin();
                break;
            case 'cancelSellService':
                // 取消申请售后
                getData();
                break;
            case 'invoice':
                // 申请开票
                getData();
                break;
            case 'sellService':
                // 申请售后
                getData();
                break;
            case 'pay':
                // 支付成功
                getData();
                break;
        }
    }

    function getBottomBtn(status) {
        status += '';
        var btns = [];
        switch (status) {
            // 待支付
            case '12':
                btns = ['cancle', 'pay'];
                break;
            // 待发货
            case '2':
                btns = ['buyAgain', 'cancle'];
                if(vm.orderInfo.closeExamineStatus == '0' || vm.orderInfo.closeExamineStatus == '1' || vm.orderInfo.closeExamineStatus == '2') {
                    btns = ['buyAgain'];
                }
                break;
            // 待收货
            case '3':
                btns = ['buyAgain', 'sellService', 'recieveGoods'];
                if(!vm.isSellService) {
                    // 不允许售后
                    btns = ['buyAgain', 'recieveGoods'];
                }
                break;
            // 已收货
            case '4':
                btns = ['buyAgain', 'sellService', 'comment'];
                if(!vm.isSellService) {
                    // 不允许售后
                    btns = ['buyAgain', 'comment'];
                }
                break;
            // 已完成 
            case '5':
                btns = ['delete', 'buyAgain'];
                break;
            // 已关闭
            case '15':
                btns = ['delete','buyAgain'];
                break;
            // 换货-待处理
            case '20_00':
                btns = ['cancelSellService'];
                break;
            // 退款-待处理
            case '20_10':
                btns = ['cancelSellService'];
                break;
            // 换货-已发货
            case '20_01':
                btns = ['sendBack'];
                break;
            // 换货-已发货
            case '20_06':
                btns = ['shRecieveGoods'];
                break;
            default:
                break;
        };
        // 以下是判断当前是否是重新开票
        if(status == '5' && vm.invoiceStatus === '-1') {
            btns.push('invoice');
        } else if(status == '5' && vm.invoiceStatus === '1') {
            btns.push('reInvoice');
        } else if(status == '5' && (vm.invoiceStatus !== '-1' || vm.invoiceStatus !== '1')) {
            btns = ['delete', 'buyAgain'];
        }
        return fnOrderStatusBtns(btns);
    }
</script>

</html>